
<template>
<view>
<mescroll-uni @init="mescrollInit" :up="upOption" :down="downOption" @down="downCallback" @up="upCallback">
	<view class="content">
		<view class="container" :style='{"minHeight":"100vh","width":"100%","padding":"0","position":"relative","background":"url(http://codegen.caihongy.cn/20240112/23f959aa396c4607b2f20ed40caa81e9.jpg) no-repeat center top / 100% auto,#f5f5f5","height":"auto"}'>
			<swiper :style='{"width":"100%","background":"none","height":"480rpx"}' class="swiper" :indicator-dots='true' :autoplay='true' :circular='true' indicator-active-color='#339933' indicator-color='rgba(0, 0, 0, .3)' :duration='500' :interval='5000' :vertical='false'>
				<swiper-item :style='{"width":"100%","background":"none","height":"100%"}' v-for="(swiper,index) in swiperList" :key="index">
					<image :style='{"width":"100%","objectFit":"contain","background":"none","display":"block","height":"100%"}' mode="aspectFill" v-if="swiper.substring(0,4)=='http'" :src="swiper" @tap="imgView(swiper)"></image>
					<image :style='{"width":"100%","objectFit":"contain","background":"none","display":"block","height":"100%"}' mode="aspectFill" v-else :src="baseUrl+swiper" @tap="imgView(baseUrl+swiper)"></image>
				</swiper-item>
			</swiper>
            <view :style='{"padding":"0px","flexWrap":"wrap","background":"none","display":"flex","width":"100%","justifyContent":"space-between","height":"auto"}' class="detail-content">
				<view :style='{"padding":"0","margin":"40rpx auto 0","borderColor":"#d8d8d8","borderRadius":"16rpx 16rpx 0 0","flexWrap":"wrap","borderWidth":"0 0 0px 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"solid","justifyContent":"space-between","height":"auto"}' class="detail-list-item price">
					<view :style='{"width":"auto","padding":"0 24rpx"}' v-if="storeupFlag==1" @click="shoucang">
						<text class="icon iconfont icon-shoucang12" :style='{"margin":"0 4rpx 0 0","lineHeight":"48rpx","fontSize":"36rpx","color":"#f9860b"}'></text>
						<text :style='{"color":"#f9860b","lineHeight":"80rpx","fontSize":"28rpx"}'>已收藏</text>
					</view>
					<view :style='{"padding":"0 24rpx","margin":"0px 0 0","textAlign":"right","background":"none","width":"auto","minWidth":"160rpx","lineHeight":"80rpx","height":"80rpx"}' v-if="storeupFlag==0" @click="shoucang">
						<text class="icon iconfont icon-shoucang11" :style='{"padding":"0px","margin":"0","color":"#f60","borderRadius":"100%","textAlign":"right","background":"#fff","width":"auto","lineHeight":"48rpx","fontSize":"36rpx","height":"48rpx"}'></text>
						<text :style='{"padding":"0px 0px","lineHeight":"80rpx","fontSize":"28rpx","color":"#f60","borderRadius":"40rpx","background":"#fff"}'>收藏</text>
					</view>
				</view>

				<view :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}' class="detail-list-item title">
					<view :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}' class="lable">景点名称：</view>
					<view :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}' class="text">{{detail.jingdianmingcheng}}</view>
				</view>
				<view :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}' class="detail-list-item title">
					<view :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}' class="lable">景点类型：</view>
					<view :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}' class="text">{{detail.jingdianleixing}}</view>
				</view>
				<view :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}' class="detail-list-item title">
					<view :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}' class="lable">等级：</view>
					<view :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}' class="text">{{detail.dengji}}</view>
				</view>

				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>景点编号：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.jingdianbianhao}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>门票：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.menpiao}}</view>
				</view>
				<view class="detail-list-item audio" :style='{"width":"calc(100% - 48rpx)","padding":"24rpx","margin":"0 auto","background":"#fff","height":"auto","order":"3"}'>
					<audio :name="title" :author="''" :style='{"width":"100%","height":"80rpx"}' :src="baseUrl+detail.yuyinjiangjie" controls></audio>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>人流量：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.renliuliang}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>开放时段：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.kaifangshiduan}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>服务电话：</view>
					<view style="text-decoration: underline" @tap="callClick(detail.fuwudianhua)"  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.fuwudianhua}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>详细地址：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.xiangxidizhi}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>点击次数：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.clicknum}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>评论数：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.discussnum}}</view>
				</view>
				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>收藏数：</view>
					<view  class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.storeupnum}}</view>
				</view>



				<view class="detail-list-item" :style='{"padding":"4rpx 24rpx 8rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>历史来源：</view>
					<view class="text" :style='{"padding":"0px","margin":"0px","color":"#666","textAlign":"left","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>{{detail.lishilaiyuan}}</view>
				</view>


				<view class="detail-list-item rich" :style='{"padding":"0 24rpx","margin":"0 auto","borderColor":"#d8d8d8","borderWidth":"0 0 2rpx 0","background":"#fff","display":"flex","width":"calc(100% - 48rpx)","borderStyle":"dashed","height":"auto"}'>
					<view class="lable" :style='{"width":"auto","padding":"0 10rpx 0 0","lineHeight":"48rpx","fontSize":"32rpx","color":"#333","textAlign":"left"}'>景点介绍：</view>
					<view class="rich-text" :style='{"padding":"0px 24rpx 24rpx 0","margin":"0","color":"#666","flex":"1","width":"auto","lineHeight":"48rpx","fontSize":"32rpx"}'>
						<rich-text :nodes="detail.jingdianjieshao"></rich-text>
					</view>
				</view>

				<!-- 热门信息 -->
				<view class="hot" :style='{"padding":"24rpx","margin":"40rpx auto","borderRadius":"16rpx","background":"#fff","width":"calc(100% - 48rpx)","height":"auto","order":"10"}'>
					<view :style='{"padding":"0 12rpx","borderColor":"#38bf3e","margin":"12rpx 0 0","color":"#333","textAlign":"left","background":"none","borderWidth":"0 0 0 4rpx","width":"100%","fontSize":"32rpx","lineHeight":"1","borderStyle":"solid","fontWeight":"600","height":"auto"}'>热门信息</view>
					<view :style='{"padding":"0","margin":"40rpx 0 0","borderRadius":"0 0 16rpx 16rpx","flexWrap":"wrap","background":"none","display":"flex","width":"100%","justifyContent":"space-between","height":"auto"}'>
						<view v-for="item in hotList" :key="item" :style='{"border":"0px solid #ed7d7b","padding":"0","margin":"0 0 40rpx","borderRadius":"12rpx","background":"#fff","width":"48%","height":"auto"}' @tap="onDetailTap(item)">
							<image :style='{"border":"0px solid #60982f","width":"100%","objectFit":"cover","borderRadius":"8rpx","display":"block","height":"220rpx"}' :src="baseUrl + (item.jingdiantupian?item.jingdiantupian.split(',')[0]:'')" alt=""></image>
							<view :style='{"padding":"0 8rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#333","textAlign":"left","width":"100%","lineHeight":"48rpx","fontSize":"32rpx","textOverflow":"ellipsis"}'>{{item.jingdianmingcheng}}</view>
							<view :style='{"padding":"0 8rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#333","textAlign":"left","width":"100%","lineHeight":"48rpx","fontSize":"32rpx","textOverflow":"ellipsis"}'>{{item.jingdianleixing}}</view>
							<view :style='{"padding":"0 8rpx","overflow":"hidden","whiteSpace":"nowrap","color":"#333","textAlign":"left","width":"100%","lineHeight":"48rpx","fontSize":"32rpx","textOverflow":"ellipsis"}'>{{item.dengji}}</view>
							<!-- <view :style='{"width":"100%","padding":"0 8rpx","lineHeight":"48rpx","fontSize":"30rpx","color":"#666","textAlign":"right"}'>2022-02-02</view> -->
						</view>
					</view>
				</view>

				<view class="time-content" :style='{"padding":"24rpx","margin":"40rpx auto 60rpx","borderRadius":"16rpx","background":"#fff","width":"calc(100% - 48rpx)","height":"auto","order":"11"}'>
					<view class="comoment-header" :style='{"border":"0px solid #60982f","boxShadow":"inset 0px -12rpx 40rpx 0px #4AB03080","padding":"0 0 0 20rpx","margin":"20rpx 0 0","borderRadius":"40rpx","background":"#fff","display":"flex","width":"100%","justifyContent":"space-between","height":"auto"}'>
						<view :style='{"padding":"0 24rpx","lineHeight":"80rpx","fontSize":"32rpx","color":"#333"}'>评论</view>
						<view :style='{"padding":"0 40rpx 0 40rpx","boxShadow":"inset 0px -60rpx 60rpx 0px #4AB030","borderRadius":"0 40rpx 40rpx 0","background":"#fff","display":"flex"}' @click="onCommentTap" class="btn-comment-content" style="display: flex;align-items: center;">
							<view :style='{"margin":"0 8rpx 0 0","lineHeight":"80rpx","fontSize":"28rpx","color":"#fff","display":"none"}' class="cuIcon-add"></view>
							<view :style='{"color":"#fff","lineHeight":"80rpx","fontSize":"32rpx"}'>添加评论</view>
						</view>
					</view>
				
					<view :style='{"padding":"24rpx","margin":"40rpx auto 0","borderColor":"#eee","borderRadius":"0","flexWrap":"wrap","background":"#fff","borderWidth":"0 0 2rpx","display":"flex","width":"calc(100% - 0px)","borderStyle":"solid","justifyContent":"space-between","height":"auto"}' v-for="(item,index) in commentList" v-bind:key="index" class="cu-item comment-item">
						<view :style='{"width":"160rpx","textAlign":"center","height":"auto"}'>
							<image :style='{"width":"80rpx","margin":"0 auto","borderRadius":"100%","display":"block","height":"80rpx"}' v-if="item.avatarurl" mode="aspectFill" :src="baseUrl+item.avatarurl"></image>
							<view :style='{"color":"#333","lineHeight":"60rpx","fontSize":"32rpx"}' class="text-grey">{{item.nickname}}</view>
						</view>
						<view :style='{"width":"calc(100% - 200rpx)","margin":"8rpx 0","lineHeight":"1.5","fontSize":"32rpx","color":"#999"}' class="text-gray text-content text-df">
							<rich-text :nodes="item.content"></rich-text>
						</view>
						<view :style='{"width":"100%","lineHeight":"48rpx","fontSize":"28rpx","color":"#999","textAlign":"right"}' class="margin-top-sm text-gray text-df">{{item.addtime}}</view>
						<view v-if="item.reply" :style='{"width":"calc(100% - 200rpx)","margin":"8rpx 0","lineHeight":"1.5","fontSize":"32rpx","color":"#999"}' class="text-gray text-content text-df">
							回复:<rich-text :nodes="item.reply"></rich-text>
						</view>
						<view style="display: flex;display: flex;justify-content: flex-end;padding: 6rpx 0;" v-if="user&&user.id==item.userid">
							<view style="color: #999;font-size: 16rpx;" @click="delClick(item.id)">删除</view>
						</view>
					</view>
				</view>

				<view class="bottom-content bg-white tabbar border shop" :style='{"padding":"0px 24rpx","margin":"20rpx 0 24rpx 0","borderRadius":"16rpx","flexWrap":"wrap","background":"none","display":"flex","width":"100%","height":"auto","order":"9"}'>

					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"21%","lineHeight":"80rpx","height":"80rpx"}' v-if="userid&&isAuth('lvyoujingdian','立即购票')" @tap="onAcrossTap('menpiaodingdan','','','','')" class="cu-btn bg-brown round shadow-blur" >立即购票</button>
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"21%","lineHeight":"80rpx","height":"80rpx"}' v-if="!userid&&isAuthFront('lvyoujingdian','立即购票')" @tap="onAcrossTap('menpiaodingdan','','','','')" class="cu-btn bg-brown round shadow-blur" >立即购票</button>
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"20%","lineHeight":"80rpx","height":"80rpx"}' v-if="userid&&isAuth('lvyoujingdian','私聊')" @tap="chatClick">联系TA</button>
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"20%","lineHeight":"80rpx","height":"80rpx"}' v-if="!userid&&isAuthFront('lvyoujingdian','私聊')" @tap="chatClick">联系TA</button>
					
					<!-- #ifdef MP-WEIXIN -->
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"20%","lineHeight":"80rpx","height":"80rpx"}' open-type="share">分享</button>
					<!-- #endif -->
					<!-- #ifdef APP-PLUS -->
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"20%","lineHeight":"80rpx","height":"80rpx"}' @click="uniShare">分享</button>
					<!-- #endif -->
					<!-- #ifdef H5 -->
					<button :style='{"border":"0","padding":"0 20rpx","margin":"0 3% 20rpx 0","color":"#fff","borderRadius":"16rpx","background":"#38bf3e","width":"auto","fontSize":"28rpx","minWidth":"20%","lineHeight":"80rpx","height":"80rpx"}' @click="shareClick">分享</button>
					<!-- #endif -->
				</view>
			</view>
		</view>
	</view>
</mescroll-uni>
	<!-- #ifdef H5 -->
	<view class="shareBG" v-if="shareShow" @click="shareShow = false"></view>
	<view class="shareBox" :class="shareShow?'shareBoxActive':''">
		<view class="shareView" @click="shareToMicroblog">
			<img src="@/static/share/weibo.png" style="width: 80%;" alt="">
			<view class="shareText">微博</view>
		</view>
		<view class="shareView" @click="shareToQQRom">
			<img src="@/static/share/qqkongjian.png" style="width: 80%;" alt="">
			<view class="shareText">QQ空间</view>
		</view>
	</view>
	<!-- #endif -->
</view>
</template>

<script>
	// #ifdef APP-PLUS
	import UniShare from 'components/uni-share/js_sdk/uni-share.js';
	const uniShare = new UniShare();
	// #endif
	export default {
		// #ifdef APP-PLUS
		onBackPress({from}) {
			if(from=='backbutton'){
				this.$nextTick(function(){
					uniShare.hide()
				})
				return uniShare.isShow;
			}
		},
		// #endif
		data() {
			return {
				btnColor: ['#409eff','#67c23a','#909399','#e6a23c','#f56c6c','#356c6c','#351c6c','#f093a9','#a7c23a','#104eff','#10441f','#a21233','#503319'],
				id: '',
                userid: '',
                hotList: [],
				detail: {},
				swiperList: [],
				commentList: [],
				mescroll: null, //mescroll实例对象
				downOption: {
					auto: false //是否在初始化后,自动执行下拉回调callback; 默认true
				},
				upOption: {
					noMoreSize: 3, //如果列表已无数据,可设置列表的总数量要大于半页才显示无更多数据;避免列表数据过少(比如只有一条数据),显示无更多数据会不好看; 默认5
					textNoMore: '~ 没有更多了 ~',
				},
				hasNext: true,
				user: {},
				storeupFlag: 0,
				count: 0,
				timer: null,
				title:'',
				// #ifdef APP-PLUS
				href: '',
				// #endif
				// #ifdef H5
				shareShow: false,
				shareUrl: location.href,
				// #endif
			}
		},
		components: {
		},
		computed: {
			baseUrl() {
				return this.$base.url;
			},
		},
		async onLoad(options) {
			// #ifdef APP-PLUS
			let page = getCurrentPages()
			this.href = this.baseUrl + 'front/h5/#/' + page[page.length - 1].route
			// #endif
			let table = uni.getStorageSync("nowTable");
			// 获取用户信息
			let res = await this.$api.session(table);
			this.user = res.data;
			this.id = options.id;
            if(options.userid) {
                this.userid = options.userid;
            }
			// 渲染数据
			this.init();
            this.hasNext = true
			// 重新加载数据
			if (this.mescroll) this.mescroll.resetUpScroll()
		},
		// #ifdef MP-WEIXIN
		onShareAppMessage(){
			var obj = {
				title: this.title,
				imageUrl: this.swiperList[0]?this.baseUrl + this.swiperList[0]: ''
			}
			return obj
		},
		// #endif
        onUnload() {
            if(this.timer) {
                clearInterval(this.timer);
            }
        },
		async onShow(options) {
			let table = uni.getStorageSync("nowTable");
			// 获取用户信息
			let res = await this.$api.session(table);
			this.user = res.data;
			this.btnColor = this.btnColor.sort(()=> {
				return (0.5-Math.random());
			});
            this.getHotList();
			this.getStoreup();
			let cleanType = uni.getStorageSync('discusslvyoujingdianCleanType')
			if(cleanType){
				uni.removeStorageSync('discusslvyoujingdianCleanType')
				this.mescroll.num = 1
				this.upCallback(this.mescroll)
				this.init(2);
			}
			let crossCleanType = uni.getStorageSync('crossCleanType')
            if(crossCleanType) {
				uni.removeStorageSync('crossCleanType')
                res = await this.$api.info('lvyoujingdian', this.id);
				let reg=new RegExp('http://localhost:8080/springboot41a5ohkj/upload','g')//g代表全部
				if(res.data.jingdianjieshao){
					res.data.jingdianjieshao = res.data.jingdianjieshao.replace(reg, this.$base.url + 'upload');
				}
                this.detail = res.data;
				this.title = this.detail.jingdianmingcheng
            }
		},
		destroyed: function() {
			//window.clearInterval(this.inter);
		},
		methods: {
			// 拨打电话
			callClick(row){
				uni.makePhoneCall({
					phoneNumber: row
				})
			},
			// #ifdef H5
			// 分享微博
			shareToMicroblog() {
				//跳转地址
				window.open(
					"https://service.weibo.com/share/share.php?url=" +
					encodeURIComponent(this.shareUrl) +
					"&title=" + this.title
				);
			},
			// 分享qq空间
			shareToQQRom() {
				//跳转地址
				window.open(
					"https://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url=" +
					encodeURIComponent(this.shareUrl) +
					"&title=" +
					this.title +
					"&summary=" +
					this.title
				);
			},
			shareClick(){
				this.shareShow = true
			},
			// #endif
			// #ifdef APP-PLUS
			uniShare() {
				uniShare.show({
					content: { //公共的分享参数配置  类型（type）、链接（herf）、标题（title）、summary（描述）、imageUrl（缩略图）
						type: 0,
						href: this.href,
						title: this.title,
						summary: this.title,
						imageUrl: this.swiperList[0]?this.baseUrl + this.swiperList[0]: ''
					},
					menus: [{
							"img": "/static/share/weixin.png",
							"text": "微信好友",
							"share": { //当前项的分享参数配置。可覆盖公共的配置如下：分享到微信小程序，配置了type=5
								"provider": "weixin",
								"scene": "WXSceneSession"
							}
						},
						{
							"img": "/static/share/pengyouquan.png",
							"text": "微信朋友圈",
							"share": {
								"provider": "weixin",
								"scene": "WXSceneTimeline"
							}
						},
						{
							"img": "/static/share/xiaochengxu.png",
							"text": "微信小程序",
							"share": {
								provider: "weixin",
								scene: "WXSceneSession",
								type: 5,
								miniProgram: {
									id: '123',
									path: '/pages/huodongxinxi/list',
									webUrl: '/#/pages/huodongxinxi/list',
									type: 0
								},
							}
						},
						{
							"img": "/static/share/weibo.png",
							"text": "微博",
							"share": {
								"provider": "sinaweibo"
							}
						},
						{
							"img": "/static/share/qq.png",
							"text": "QQ",
							"share": {
								"provider": "qq"
							}
						},
						{
							"img": "/static/share/fuzhi.png",
							"text": "复制",
							"share": "copyurl"
						},
						{
							"img": "/static/share/gengduo.png",
							"text": "更多",
							"share": "shareSystem"
						}
					],
					cancelText: "取消分享",
				}, e => { //callback
				})
			},
			// #endif
			// 支付
			onPayTap(){
				let that = this
				if(!this.user){
					this.$utils.msg("请先登录")
					setTimeout(()=>{
						that.$utils.jump('../login/login')
					},1500)
					return false
				}
				uni.setStorageSync('paytable','lvyoujingdian');
				uni.setStorageSync('payObject',this.detail);
				this.$utils.jump('../pay-confirm/pay-confirm?type=1')
			},
            onDetailTap(item) {
                uni.setStorageSync("useridTag",this.userid);
                this.$utils.jump(`./detail?id=${item.id}&userid=`+this.userid)
            },
          async getHotList() {
            let res;
            res = await this.$api.recommend('lvyoujingdian', {
                page: 1,
                limit: 4
            });
            this.hotList = res.data.list
          },
			// 收藏
			async getStoreup() {
				if(!this.user){
					return false
				}
				let params = {
					page: 1,
					limit: 1,
					refid : this.id,
					tablename : 'lvyoujingdian',
					userid: this.user.id,
					type: 1,
				}
				let res = await this.$api.list(`storeup`, params);
				this.storeupFlag = res.data.list.length;
			},
			async shoucang(){
				let that = this
				if(!this.user){
					this.$utils.msg("请先登录")
					setTimeout(()=>{
						that.$utils.jump('../login/login')
					},1500)
					return false
				}
				let _this = this;
				let params = {
					page: 1,
					limit: 1,
					refid : _this.detail.id,
					tablename : 'lvyoujingdian',
					userid: _this.user.id,
					type: 1,
				}
				let res = await _this.$api.list(`storeup`, params);
				if (res.data.list.length == 1) {
					let storeupId = res.data.list[0].id;
					uni.showModal({
						title: '提示',
						content: '是否取消',
						success: async function(res) {
							if (res.confirm) {
								_this.detail.storeupnum--
								await _this.$api.update('lvyoujingdian',_this.detail)
								await _this.$api.del('storeup', JSON.stringify([storeupId]));
								_this.$utils.msg('取消成功');
								_this.getStoreup();
							}
						}
					});
					return;
				}
				uni.showModal({
					title: '提示',
					content: '是否收藏',
					success: async function(res) {
						if (res.confirm) {
							await _this.$api.add('storeup', {
								userid: _this.user.id,
								name: _this.detail.jingdianmingcheng,
                                inteltype: _this.detail.jingdianleixing,
								picture: _this.swiperList[0],
								refid: _this.detail.id,
								tablename: 'lvyoujingdian',
                                type: 1
							});
							_this.detail.storeupnum++
							await _this.$api.update('lvyoujingdian',_this.detail)
							_this.$utils.msg('收藏成功');
							_this.getStoreup();
						}
					}
				});
			},
			// 跨表
			async onAcrossTap(tableName,crossOptAudit,crossOptPay,statusColumnName,tips,statusColumnValue,type=1){
				let that = this
				if(!this.user){
					this.$utils.msg("请先登录")
					setTimeout(()=>{
						that.$utils.jump('../login/login')
					},1500)
					return false
				}
				uni.setStorageSync('crossTable','lvyoujingdian');
				uni.setStorageSync(`crossObj`, this.detail);
				uni.setStorageSync(`statusColumnName`, statusColumnName);
				uni.setStorageSync(`statusColumnValue`, statusColumnValue);
				uni.setStorageSync(`tips`, tips);
				if(statusColumnName!=''&&!statusColumnName.startsWith("[")) {
					var obj = uni.getStorageSync('crossObj');
					for (var o in obj){
						if(o==statusColumnName && obj[o]==statusColumnValue){
							this.$utils.msg(tips);
							return
						}
					}
				}
				this.$utils.jump(`../${tableName}/add-or-update?cross=true`);
			},
			// 获取详情
			async init(type=1){
                if(this.timer) {
                    clearInterval(this.timer);
                }
				let res = await this.$api.info('lvyoujingdian', this.id);
				let reg=new RegExp('http://localhost:8080/springboot41a5ohkj/upload','g')//g代表全部
				res.data.jingdianjieshao = res.data.jingdianjieshao.replace(reg, this.$base.url + 'upload');
				this.detail = res.data;

				this.title = this.detail.jingdianmingcheng




				// 轮播图片
				this.swiperList = this.detail.jingdiantupian ? this.detail.jingdiantupian.split(",") : [];
				









				//修改富文本的图片样式
				this.detail.jingdianjieshao = this.detail.jingdianjieshao.replace(/img src/gi,"img style=\"width:100%;\" src");




				if(type==2){
					this.detail.discussnum++
					await this.$api.update('lvyoujingdian',this.detail)
				}
			},
			// mescroll组件初始化的回调,可获取到mescroll对象
			mescrollInit(mescroll) {
				this.mescroll = mescroll;
			},

			/*下拉刷新的回调 */
			downCallback(mescroll) {
				this.hasNext = true
				mescroll.resetUpScroll()
			},

			/*上拉加载的回调: mescroll携带page的参数, 其中num:当前页 从1开始, size:每页数据条数,默认10 */
			async upCallback(mescroll) {
				if(uni.getStorageSync("appUserid")){
					let res = await this.$api.list('discusslvyoujingdian', {
						page: mescroll.num,
						limit: 10,
						refid: Number(this.id)
					});
					// 如果是第一页数据置空
					if (mescroll.num == 1) this.commentList = [];
					for(let x in res.data.list){
						if(res.data.list[x].content){
							res.data.list[x].content = res.data.list[x].content.replace(/img src/gi,"img style=\"width:100%;\" src")
						}
					}
					this.commentList = this.commentList.concat(res.data.list);
					if (res.data.list.length == 0) this.hasNext = false;
				}
				mescroll.endSuccess(mescroll.size, this.hasNext);

            },



			onChatTap() {
				this.$utils.jump('../chat/chat')
			},
			// 下载
			download(url){
				let _this = this;
				url=_this.$base.url +  url;
				uni.downloadFile({
					url: url,
					success: (res) => {
						if (res.statusCode === 200) {
							_this.$utils.msg('下载成功');
							// #ifdef H5
							 window.open(url);
							// #endif
							// #ifndef H5
							uni.saveFile({
							 	tempFilePath: res.tempFilePath, //临时路径
							 	success: function(obj) {
							 		uni.showToast({
							 			icon: 'success',
							 			mask: true,
							 			title: '下载成功' , 
							 			duration: 2000,
							 		});
									setTimeout(() => {
										console.log('obj.savedFilePath',obj.savedFilePath);
										var filePath = obj.savedFilePath;
										uni.openDocument({ //新开页面打开文档，支持格式：doc, xls, ppt, pdf, docx, xlsx, pptx。
											filePath: filePath,
											showMenu: true,
											success: function(res) {
												console.log('打开文档成功');
											}
										});
									}, 2000)
							 	}
							});
							// #endif
						}
					}
				});
			},
			//
			onCartTabTap() {
				this.$utils.tab('../shop-cart/shop-cart')
			},
			// 添加评论
			async onCommentTap() {
				let that = this
				if(!this.user){
					this.$utils.msg("请先登录")
					setTimeout(()=>{
						that.$utils.jump('../login/login')
					},1500)
					return false
				}
				this.$utils.jump(`../discusslvyoujingdian/add-or-update?refid=${this.id}`)
			},
			delClick(id){
				let that = this
				uni.showModal({
					title: '提示',
					content: '是否删除此评论？',
					async success(res) {
						if(res.confirm){
							await that.$api.del('discusslvyoujingdian',JSON.stringify([id]))
							that.$utils.msg('删除成功')
							that.detail.discussnum--
							await that.$api.update('lvyoujingdian',that.detail)
							setTimeout(()=>{
								that.upCallback(that.mescroll)
							},1500)
						}
					}
				})
			},
		}
	}
</script>

<style lang="scss">
	page {
	  --animate-duration: 1s;
	  --animate-delay: 1s;
	  --animate-repeat: 1;
	}
	
	.content {
		min-height: calc(100vh - 44px);
		box-sizing: border-box;
	}
	
	.seat-list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		background: #FFFFFF;
		margin: 20upx;
		border-radius: 20upx;
		padding: 20upx;
		font-size: 30upx;
		.seat-item {
			width: 33.33%;
			display: flex;
			align-items: center;
			flex-direction: column;
			margin-bottom: 20upx;
	
			.seat-icon {
				width: 50upx;
				height: 50upx;
				margin-bottom: 10upx;
			}
		}
	}
	
	audio {
		display: flex;
		flex-direction: column;
	}
	
	.audio /deep/ .uni-audio-default {
		width: inherit;
	}
	// #ifdef H5
	.shareBG{
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		height: 100%;
		background: rgba(0,0,0,.3);
		z-index: 665;
	}
	.shareBox {
		width: 100%;
		position: fixed;
		height: 20%;
		right: 0;
		bottom: 0;
		z-index: 666;
		-webkit-transform: translate3d(0, 100%, 0);
		transform: translate3d(0, 100%, 0);
		transition: transform .3s;
		overflow-y: scroll;
		background: #fff;
		display: flex;
		align-items: center;
		justify-content: space-around;
	}
	.shareBoxActive {
		-webkit-transform: translate3d(0%, 0, 0);
		transform: translate3d(0%, 0, 0);
	}
	.shareView {
		width: 20%;
		display: flex;
		flex-direction: column;
		align-items: center;
		.shareText {
			font-size: 24rpx;
			padding: 10rpx 0 0 ;
		}
	}
	// #endif
	

</style>
